\(\int \frac {\cos (c+d x) (a B+b B \cos (c+d x))}{a+b \cos (c+d x)} \, dx\) [283]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [F(-2)]
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 32, antiderivative size = 11 \[ \int \frac {\cos (c+d x) (a B+b B \cos (c+d x))}{a+b \cos (c+d x)} \, dx=\frac {B \sin (c+d x)}{d} \]

[Out]

B*sin(d*x+c)/d

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 11, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.062, Rules used = {21, 2717} \[ \int \frac {\cos (c+d x) (a B+b B \cos (c+d x))}{a+b \cos (c+d x)} \, dx=\frac {B \sin (c+d x)}{d} \]

[In]

Int[(Cos[c + d*x]*(a*B + b*B*Cos[c + d*x]))/(a + b*Cos[c + d*x]),x]

[Out]

(B*Sin[c + d*x])/d

Rule 21

Int[(u_.)*((a_) + (b_.)*(v_))^(m_.)*((c_) + (d_.)*(v_))^(n_.), x_Symbol] :> Dist[(b/d)^m, Int[u*(c + d*v)^(m +
 n), x], x] /; FreeQ[{a, b, c, d, n}, x] && EqQ[b*c - a*d, 0] && IntegerQ[m] && ( !IntegerQ[n] || SimplerQ[c +
 d*x, a + b*x])

Rule 2717

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = B \int \cos (c+d x) \, dx \\ & = \frac {B \sin (c+d x)}{d} \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(23\) vs. \(2(11)=22\).

Time = 0.00 (sec) , antiderivative size = 23, normalized size of antiderivative = 2.09 \[ \int \frac {\cos (c+d x) (a B+b B \cos (c+d x))}{a+b \cos (c+d x)} \, dx=B \left (\frac {\cos (d x) \sin (c)}{d}+\frac {\cos (c) \sin (d x)}{d}\right ) \]

[In]

Integrate[(Cos[c + d*x]*(a*B + b*B*Cos[c + d*x]))/(a + b*Cos[c + d*x]),x]

[Out]

B*((Cos[d*x]*Sin[c])/d + (Cos[c]*Sin[d*x])/d)

Maple [A] (verified)

Time = 0.64 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.09

method result size
derivativedivides \(\frac {B \sin \left (d x +c \right )}{d}\) \(12\)
default \(\frac {B \sin \left (d x +c \right )}{d}\) \(12\)
risch \(\frac {B \sin \left (d x +c \right )}{d}\) \(12\)
parallelrisch \(\frac {B \sin \left (d x +c \right )}{d}\) \(12\)
norman \(\frac {\frac {2 B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {2 B \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}\) \(50\)

[In]

int(cos(d*x+c)*(B*a+b*B*cos(d*x+c))/(a+cos(d*x+c)*b),x,method=_RETURNVERBOSE)

[Out]

B*sin(d*x+c)/d

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 11, normalized size of antiderivative = 1.00 \[ \int \frac {\cos (c+d x) (a B+b B \cos (c+d x))}{a+b \cos (c+d x)} \, dx=\frac {B \sin \left (d x + c\right )}{d} \]

[In]

integrate(cos(d*x+c)*(a*B+b*B*cos(d*x+c))/(a+b*cos(d*x+c)),x, algorithm="fricas")

[Out]

B*sin(d*x + c)/d

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 31 vs. \(2 (8) = 16\).

Time = 0.34 (sec) , antiderivative size = 31, normalized size of antiderivative = 2.82 \[ \int \frac {\cos (c+d x) (a B+b B \cos (c+d x))}{a+b \cos (c+d x)} \, dx=\begin {cases} \frac {B \sin {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\\frac {x \left (B a + B b \cos {\left (c \right )}\right ) \cos {\left (c \right )}}{a + b \cos {\left (c \right )}} & \text {otherwise} \end {cases} \]

[In]

integrate(cos(d*x+c)*(a*B+b*B*cos(d*x+c))/(a+b*cos(d*x+c)),x)

[Out]

Piecewise((B*sin(c + d*x)/d, Ne(d, 0)), (x*(B*a + B*b*cos(c))*cos(c)/(a + b*cos(c)), True))

Maxima [F(-2)]

Exception generated. \[ \int \frac {\cos (c+d x) (a B+b B \cos (c+d x))}{a+b \cos (c+d x)} \, dx=\text {Exception raised: ValueError} \]

[In]

integrate(cos(d*x+c)*(a*B+b*B*cos(d*x+c))/(a+b*cos(d*x+c)),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*b^2-4*a^2>0)', see `assume?`
 for more de

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 11, normalized size of antiderivative = 1.00 \[ \int \frac {\cos (c+d x) (a B+b B \cos (c+d x))}{a+b \cos (c+d x)} \, dx=\frac {B \sin \left (d x + c\right )}{d} \]

[In]

integrate(cos(d*x+c)*(a*B+b*B*cos(d*x+c))/(a+b*cos(d*x+c)),x, algorithm="giac")

[Out]

B*sin(d*x + c)/d

Mupad [B] (verification not implemented)

Time = 0.56 (sec) , antiderivative size = 11, normalized size of antiderivative = 1.00 \[ \int \frac {\cos (c+d x) (a B+b B \cos (c+d x))}{a+b \cos (c+d x)} \, dx=\frac {B\,\sin \left (c+d\,x\right )}{d} \]

[In]

int((cos(c + d*x)*(B*a + B*b*cos(c + d*x)))/(a + b*cos(c + d*x)),x)

[Out]

(B*sin(c + d*x))/d